package vmcs.simulationsystem;

import java.awt.event.ActionListener;

import vmcs.common.Constant;
import vmcs.controller.MainController;
import vmcs.controller.SimulationController;
import vmcs.controller.TransactionController;

public class PanelButtonListenerFactory {
	private MainController mainCtrl;
	private SimulationController simulationCtrl;
	private TransactionController transactionctrl;

	public PanelButtonListenerFactory(MainController controller){
		this.simulationCtrl = controller.getSimulationController();
		this.mainCtrl = controller;		
		this.transactionctrl = controller.getTransactionController();
	}
	//PanelButtonListenerFactory(SimulationController controller){
	//this.simulationCtrl = controller;	
	//}
	public ActionListener getButtonListener(String ButtonListenerType){
		switch(ButtonListenerType){
		case Constant.L_SIMUL_BEGIN: return new BeginSimulationButtonListener(this.simulationCtrl);
		case Constant.L_ACT_MAINTAINER: return new ActivateMaintainerPanelButtonListener(this.simulationCtrl);
		case Constant.L_ACT_MACHINERY: return new ActivateMachineryPanelButtonListener(this.simulationCtrl);
		case Constant.L_ACT_CUSTOMER: return new ActivateCustomerPanelButtonListener(this.simulationCtrl);
		case Constant.L_SIMUL_END: return new EndSimulationButtonListener(this.mainCtrl);
		case Constant.CUST_TR_TRANS:  return new TerminateButtonListener(this.transactionctrl);
		//case M_T_CASH:  return new TotalCashButtonListener(maintenanceCtrl);
		//case M_TR_CASH:  return new TransferCashButtonListener(maintenanceCtrl);
		//case M_EX:  return new ExitButtonListener(maintenanceCtrl);
		default: return null;

		}

	}

}
